home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-03 | 4.1 KB | 136 lines | [TEXT/MPS ] |
- //----------------------------------------------------------------------------------------
- // USkeletonApplication.cp
- // Copyright © 1996 by Apple Computer, Inc. All rights reserved.
- //----------------------------------------------------------------------------------------
-
- #ifndef __UQD3DApplication__
- #include "UQD3DApplication.h"
- #endif
-
- #ifndef __UCustomViewerDocument__
- #include "UCustomViewerDocument.h"
- #endif
-
- #ifndef __UDefaultDocument__
- #include "UDefaultDocument.h"
- #endif
-
- #ifndef __UQD3DViewer__
- #include "UQD3DViewer.h"
- #endif
-
- #ifndef __UMENUMGR__
- #include "UMenuMgr.h"
- #endif
-
- //----------------------------------------------------------------------------------------
- // Constants:
-
- const OSType kSignature = 'SS13'; // Application signature
- const OSType kFileType = 'SF13'; // File Type
- CommandNumber cNewCustom = 1717; // New CustomViewer Command
-
- //========================================================================================
- // CLASS TQD3DApplication
- //========================================================================================
- #undef Inherited
- #define Inherited TApplication
-
- #pragma segment AInit
- MA_DEFINE_CLASS_M1(TQD3DApplication, Inherited);
-
- //----------------------------------------------------------------------------------------
- // TQD3DApplication constructor
- //----------------------------------------------------------------------------------------
- #pragma segment AOpen
-
- TQD3DApplication::TQD3DApplication()
- {
- // Initialize fields to safe values here
- }
-
- //----------------------------------------------------------------------------------------
- // TQD3DApplication destructor
- //----------------------------------------------------------------------------------------
- #pragma segment MADestructorRes
-
- TQD3DApplication::~TQD3DApplication()
- {
- }
-
- //----------------------------------------------------------------------------------------
- // TQD3DApplication::IQD3DApplication:
- //----------------------------------------------------------------------------------------
- #pragma segment AInit
-
- void TQD3DApplication::IQD3DApplication()
- {
- this->IApplication(kFileType,kSignature);
- } // TQD3DApplication::IQD3DApplication
-
- //----------------------------------------------------------------------------------------
- // TQD3DApplication::DoMakeDocument:
- //----------------------------------------------------------------------------------------
- #pragma segment AOpen
-
- TDocument* TQD3DApplication::DoMakeDocument(CommandNumber itsCommandNumber,
- TFile* itsFile) // Override
- {
- switch (itsCommandNumber)
- {
- case 1717:
- TCustomViewerDocument* aCustomDocDocument = new TCustomViewerDocument;
- aCustomDocDocument->ICustomViewerDocument();
- return aCustomDocDocument;
- break;
-
- case cFinderNew:
- case cNew:
- TDefaultDocument* aDocument = new TDefaultDocument;
- aDocument->IDefaultDocument();
- return aDocument;
- break;
-
- default:
- return Inherited::DoMakeDocument(itsCommandNumber,itsFile);
- break;
- }
- } // TQD3DApplication::DoMakeDocument
-
- //----------------------------------------------------------------------------------------
- // TQD3DApplication::DoSetupMenus:
- //----------------------------------------------------------------------------------------
- #pragma segment MAApplicationRes
-
- void TQD3DApplication::DoSetupMenus() // Override
- {
- Inherited::DoSetupMenus();
-
- Boolean lowSpace = MemSpaceIsLow();
- Enable(cNewCustom, !lowSpace);
- } // TQD3DApplication::DoSetupMenus
-
- //----------------------------------------------------------------------------------------
- // TQD3DApplication::DoMenuCommand:
- //----------------------------------------------------------------------------------------
- #pragma segment MASelCommand
-
- void TQD3DApplication::DoMenuCommand(CommandNumber aCommandNumber)
- {
- switch (aCommandNumber)
- {
- case 1717:
- this->DoNew(cNewCustom);
- break;
-
- default:
- Inherited::DoMenuCommand(aCommandNumber);
- break;
- }
- } // TQD3DApplication::DoSetupMenus
-
- //----------------------------------------------------------------------------------------
- // End of UQD3DApplication.cp
-
- #pragma segment Inline
-